package com.lingyue.entity.module.biz.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;

/**
 * <p>
 * 
 * </p>
 *
 * @author Baijinhua
 * @since 2020-03-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("opportunities_item")
@ApiModel(value="OpportunitiesItemEntity对象", description="")
public class OpportunitiesItemEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId("OPI_ITEM_ID")
    @JsonProperty("item_id")
    @NotBlank(message = "item_id not be empty")
    private String itemId;

    @ApiModelProperty(value = "opportunities 表主键ID")
    @TableField("OPI_OPT_ID")
    private Long optId;

    @ApiModelProperty(value = "经销商id")
    @TableField("OPI_DEL_ID")
    private Long delId;

    @ApiModelProperty(value = "ITEM CODE")
    @TableField("OPI_ITEM_CODE")
    @JsonProperty("item_code")
    @NotBlank(message = "item_code not be empty")
    private String itemCode;

    @ApiModelProperty(value = "ITEM NAME")
    @TableField("OPI_ITEM_NAME")
    @JsonProperty("item_name")
    @NotBlank(message = "item_name not be empty")
    private String itemName;

    @ApiModelProperty(value = "CAMPAIGN IDENTIFIER（E-EXPIRED、D-DEFAULT、1-GO TO HIS SHOP、2-BACK TO THE STORE）")
    @TableField("OPI_LEADS_STATUS")
    @JsonProperty("leads_status")
    @NotBlank(message = "leads_status not be empty")
    @Pattern(regexp = "^E|D|1|2$", message = "leads_status is invalid")
    private String leadsStatus;

    @ApiModelProperty(value = "WHETHER TO ARRIVE AT THE SHOP WITHIN 70 DAYS(Y/N) ONLY TSSB")
    @JsonProperty("arrival_status")
    @TableField("OPI_ARRIVAL_STATUS")
    @Pattern(regexp = "^$|Y|N$", message = "arrival_status is invalid")
    private String arrivalStatus;

    @ApiModelProperty(value = "CAMPAIGN背景", hidden = true)
    @TableField("OPI_CAMPAIGN_BACKGROUND")
    private String campaignBackground;

    @ApiModelProperty(value = "CAMPAIGN背景")
    @TableField(exist = false)
    @JsonProperty("campaign_background")
    @Size(min = 1, message = "campaign_background not be empty")
    private Map<String, String> campaignBackgroundJson;

    @ApiModelProperty(value = "CPD状态")
    @TableField("OPI_RESPONSE_STATUS")
    private Integer responseStatus;

    @ApiModelProperty(value = "处理时间")
    @TableField("OPI_RESPONSE_DATE")
    private LocalDateTime responseDate;

    @ApiModelProperty(value = "是否接通")
    @TableField("OPI_CONNECTED")
    private String connected;

    @ApiModelProperty(value = "预约时间")
    @TableField("OPI_APPOINTMENT_DATE")
    private LocalDateTime appointmentDate;

    @ApiModelProperty(value = "计划跟进时间")
    @TableField("OPI_RESCHEDULED_DATE")
    private LocalDateTime rescheduledDate;

    @ApiModelProperty(value = "联系方式: 微信/座机等,详见数据字典")
    @TableField("OPI_CONTACT_WAY")
    private String contactWay;

    @ApiModelProperty(value = "到店类型")
    @TableField("OPI_APPOINTMENT_TYPE")
    private String appointmentType;

    @ApiModelProperty(value = "一级战败")
    @TableField("OPI_TYPE_FIRST")
    private String typeFirst;

    @ApiModelProperty(value = "二级战败")
    @TableField("OPI_TYPE_SECOND")
    private String typeSecond;

    @ApiModelProperty(value = "三级战败")
    @TableField("OPI_TYPE_OTHER")
    private String typeOther;

    @ApiModelProperty(value = "一级流失")
    @TableField("OPI_LOSS_DIRECTION")
    private String lossDirection;

    @ApiModelProperty(value = "二级流失")
    @TableField("OPI_LOSS_DIRECTION_SUB")
    private String lossDirectionSub;

    @ApiModelProperty(value = "是否有效线索")
    @TableField("OPI_VALID")
    private String valid;

    @ApiModelProperty(value = "备注")
    @TableField("OPI_REMARK")
    private String remark;

    @ApiModelProperty(value = "是否终结")
    @TableField(exist = false)
    private boolean finished;

    @ApiModelProperty(value = "记录创建人", hidden = true)
    @TableField("OPI_CREATE_USER")
    private String createUser;

    @ApiModelProperty(value = "记录创建日期",hidden = true)
    @TableField("OPI_CREATE_DATE")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "记录修改人", hidden = true)
    @TableField("OPI_UPDATE_USER")
    private String updateUser;

    @ApiModelProperty(value = "记录修改日期", hidden = true)
    @TableField("OPI_UPDATE_DATE")
    private LocalDateTime updateDate;


    public static final String OPI_ITEM_ID = "OPI_ITEM_ID";

    public static final String OPI_OPT_ID = "OPI_OPT_ID";

    public static final String OPI_DEL_ID = "OPI_DEL_ID";

    public static final String OPI_ITEM_CODE = "OPI_ITEM_CODE";

    public static final String OPI_ITEM_NAME = "OPI_ITEM_NAME";

    public static final String OPI_LEADS_STATUS = "OPI_LEADS_STATUS";

    public static final String OPI_ARRIVAL_STATUS = "OPI_ARRIVAL_STATUS";

    public static final String OPI_CAMPAIGN_BACKGROUND = "OPI_CAMPAIGN_BACKGROUND";

    public static final String OPI_RESPONSE_STATUS = "OPI_RESPONSE_STATUS";

    public static final String OPI_RESPONSE_DATE = "OPI_RESPONSE_DATE";

    public static final String OPI_CONNECTED = "OPI_CONNECTED";

    public static final String OPI_APPOINTMENT_DATE = "OPI_APPOINTMENT_DATE";

    public static final String OPI_RESCHEDULED_DATE = "OPI_RESCHEDULED_DATE";

    public static final String OPI_CONTACT_WAY = "OPI_CONTACT_WAY";

    public static final String OPI_APPOINTMENT_TYPE = "OPI_APPOINTMENT_TYPE";

    public static final String OPI_VALID = "OPI_VALID";
    public static final String OPI_REMARK = "OPI_REMARK";
    public static final String OPI_TYPE_FIRST = "OPI_TYPE_FIRST";
    public static final String OPI_TYPE_SECOND = "OPI_TYPE_SECOND";
    public static final String OPI_TYPE_OTHER = "OPI_TYPE_OTHER";
    public static final String OPI_LOSS_DIRECTION = "OPI_LOSS_DIRECTION";
    public static final String OPI_LOSS_DIRECTION_SUB = "OPI_LOSS_DIRECTION_SUB";

    public static final String OPI_CREATE_USER = "OPI_CREATE_USER";

    public static final String OPI_CREATE_DATE = "OPI_CREATE_DATE";

    public static final String OPI_UPDATE_USER = "OPI_UPDATE_USER";

    public static final String OPI_UPDATE_DATE = "OPI_UPDATE_DATE";

}
